package dbops

import (
	"database/sql"
	_ "github.com/go-sql-driver/mysql"
	"log"
)

var dbConn *sql.DB
var err error

func init() {
	//写在init里面以实现复用dbConn
	dbConn, err = sql.Open("mysql",
		"root:13786296497@tcp(localhost:3306)/videoserver?charset=utf8")
	if err != nil {
		log.Println("数据库连接初始化失败！")
		panic(err.Error()) //panic中断整个程序
	}
}
